home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 3
/
Gold Medal Software - Volume 3 (Gold Medal) (1994).iso
/
print
/
cramv33.arj
/
FILTER.C
< prev
next >
Wrap
Text File
|
1991-10-12
|
733b
|
41 lines
#include <stdio.h>
void _nullcheck();
void _setenvp();
void _setargv();
#define REC_SIZE 256
int main ()
{
int status = 0;
char file_buf[REC_SIZE];
while ( (status = fread (file_buf, 1, REC_SIZE, stdin) ) != 0 ) {
filter_rec (file_buf, status);
}
return (0);
}
void _nullcheck () {};
void _setenvp () {};
void _setargv () {};
int filter_rec (file_buf, record_size)
char *file_buf;
int record_size;
{
int i;
static int cr_detected = 0;
for (i = 0; i < record_size; i++) {
if (file_buf[i] == 0x0D) cr_detected = 1;
if (file_buf[i] == 0x0A) cr_detected = 0;
if (!cr_detected) putc (file_buf[i], stdout);
};
return 1;
}